package home.projects.recipes.chapthree;

import javax.management.MBeanServer;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ChapThreeRunner {

   public static void main(final String[] args) {
      ApplicationContext ctx = new ClassPathXmlApplicationContext(
            "home/projects/recipes/config/context-chapthree.xml");
      HelloWorld hw = (HelloWorld)ctx.getBean("helloBean");
      hw.sayHello();
      ISequenceGenerator generator = (ISequenceGenerator)ctx.getBean("oneSeqBean");
      for(int i = 0; i < 4; ++i) System.out.println(generator.next());
      generator = (ISequenceGenerator)ctx.getBean("twoSeqBean");
      for(int i = 0; i < 4; ++i) System.out.println(generator.next());
   }

}
